﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ERPClient
{
    public partial class BOMQueryForm : Form
    {
        private int filter_date = 0;
        public BOMQueryForm()
        {
            InitializeComponent();

            //grid_index.LoadFromXML("..\\..\\Inventory.xml");

            //product
            grid1.Rows = 50;
            grid1.Cols = 4;

            string [] title = { "產品編號", "產品名稱", "單位", "建立日期" };
            FlexCell.CellTypeEnum[] type = 
                                        {
                                            FlexCell.CellTypeEnum.TextBox,
                                            FlexCell.CellTypeEnum.TextBox,
                                            FlexCell.CellTypeEnum.ComboBox,
                                            FlexCell.CellTypeEnum.DateTime,
                                        };
            short[] widths = { 80, 160, 50, 300 };
            for (int i = 0; i < 4; i++)
            {
                grid1.Cell(0, i).Text = title[i];
                grid1.Column(i).CellType = type[i];
                grid1.Column(i).Width = widths[i];
                grid1.Column(i).Alignment = FlexCell.AlignmentEnum.LeftCenter;
            }


            //bom
            grid2.Rows = 50;
            grid2.Cols = 7;

            string[] title2 = { "No", "零件編號", "品名規格", "應用數量", "單位", "庫存量", "缺料量" };
            FlexCell.CellTypeEnum[] type2 = 
                                        {
                                            FlexCell.CellTypeEnum.DefaultType,
                                            FlexCell.CellTypeEnum.TextBox,
                                            FlexCell.CellTypeEnum.TextBox,
                                            FlexCell.CellTypeEnum.TextBox,
                                            FlexCell.CellTypeEnum.ComboBox,
                                            FlexCell.CellTypeEnum.TextBox,
                                            FlexCell.CellTypeEnum.TextBox,
                                        };
            short[] widths2 = { 30, 120, 200, 80, 50, 80, 80 };
            for (int i = 0; i < 7; i++)
            {
                grid2.Cell(0, i).Text = title2[i];
                grid2.Column(i).CellType = type2[i];
                grid2.Column(i).Width = widths2[i];
                grid2.Column(i).Alignment = FlexCell.AlignmentEnum.LeftCenter;
            }
        }
    }
}
